<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit"/>
    <title>{block name="title"} 敏捷开发管理系统-太阳软件{/block}</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    {include file="common/head_css" /}
    {:load_res('js','20180303',['/static/js/jquery/jquery.min.js','/static/admin/js/gdbase.js'])}
    <style>
        .box{margin-bottom:5px;border:none;}
    </style>
</head>
<body>
<div class="box" id="app">
    <form class="form-horizontal ajaxForm3" name="form0" method="post" action="{:url('')}">
        <input type="hidden" name="id" value="{$orderModel['id']}">
        <input type="hidden" name="type" value="{$type}">
        {if('seller_remark' == $type)}
        <div class="modal-body">
            <textarea style="height:150px;" class="form-control" name="seller_remark" placeholder="卖家备注">{$orderModel['seller_remark']}</textarea>
        </div>
        {/if}
        {if('address' == $type)}
        <div class="modal-body">
            <div class="form-group">
                <label class="col-sm-2 control-label">收货人 :</label>
                <div class="col-sm-9 col-xs-12">
                    <input type="text" name="address[realname]" class="form-control" value="{$orderModel['address']['realname']}" data-rule-required="true" aria-required="true">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">手机 :</label>
                <div class="col-sm-9 col-xs-12">
                    <input type="text" name="address[mobile]" class="form-control" value="{$orderModel['address']['mobile']}" data-rule-required="true" aria-required="true">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">地址 :</label>
                <div class="col-sm-9 col-xs-12">
                    <span class="help-block">
                        {$orderModel['address']['province']} {$orderModel['address']['city']} {$orderModel['address']['area']} {$orderModel['address']['address']}
                    </span>
                </div>
            </div>
            <div class="form-group dispatch_info">
                <label class="col-sm-2 control-label">修改地址 :</label>
                <div class="col-sm-9 col-xs-12">
                    <label class="radio-inline"><input type="radio" name="address[changead]" value="0" checked="true" class="valid"> 否</label>
                    <label class="radio-inline"><input type="radio" name="address[changead]" value="1" aria-invalid="false" class="valid"> 是</label>
                    <span class="help-block">选“是”时修改下面新地址才有效</span>
                </div>
            </div>
            <div class="form-group ad-group" style="">
                <label class="col-sm-2 control-label">新地址 :</label>
                <div class="col-sm-9 col-xs-12">
                    <p>
                        <select id="sel-provance" name="address[province]" onchange="selectCity();" class="select form-control select-group" style="width:123px;display:inline;"></select>
                        <select id="sel-city" name="address[city]" onchange="selectcounty(0)" class="select form-control select-group" style="width:135px;display:inline;"></select>
                        <select id="sel-area" name="address[area]" onchange="selectstreet(0)" class="select form-control select-group" style="width:130px;display:inline;"></select>
                        <!-- 后期开启 新地址 带街道
                        <select id="sel-street" name="street" class="select form-control select-group" style="width:220px;display:inline;margin-top: 10px;">
                            <option value="" selected="true">请选择</option>
                        </select>
                        -->
                    </p>
                    <input type="text" name="address[address]" class="form-control" value="{$orderModel['address']['address']}" data-rule-required="true" aria-required="true">
                </div>
            </div>
        </div>
        {/if}
        {if('send' == $type || 'modify_send' == $type)}
        <div class="modal-body">
            <div class="form-group">
                <label class="col-sm-2 control-label">收 货 人</label>
                <div class="col-sm-9 col-xs-12">
                    <div class="form-control-static">
                        联系人: {$orderModel['address']['realname']} / {$orderModel['address']['mobile']} <br/>
                        地    址: {$orderModel['address']['province']}{$orderModel['address']['city']}{$orderModel['address']['area']} {$orderModel['address']['address']}
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">快递公司</label>
                <div class="col-sm-9 col-xs-12">
                    <select class="form-control" name="send[oe_express]" id="express">
                        <option value="" data-name="">其他快递</option>
                        {volist name="expressList" id="el"}
                        <option value="{$el['express']}" data-name="{$el['name']}" {if $orderModel['oe_express'] == $el['express']}selected{/if}>{$el['name']}</option>
                        {/volist}
                    </select>
                    <input type='hidden' name='send[oe_express_com]' id='expresscom' value="{$orderModel['oe_express_com']}"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label must">快递单号</label>
                <div class="col-sm-9 col-xs-12">
                    <input type="text" name="send[oe_express_sn]" class="form-control" value="{$orderModel['oe_express_sn']}" data-rule-required='true' />
                </div>
            </div>
        </div>
        {/if}
        {if('cancel_send' == $type)}
        <div class="modal-body">
            <textarea style="height:150px;" class="form-control" name="cancel_send_remark" placeholder="取消原因"></textarea>
        </div>
        {/if}
        <!-- /.box-body -->
        <div class="box-footer">
            <div class="row">
                <div class="col-xs-4"></div>
                <button type="submit" class="btn btn-info ladda-button col-xs-1" data-style="expand-left" data-plugin="ladda">
                    <span class="ladda-label"><i class="icon wb-arrow-expand margin-right-10" aria-hidden="true"></i>提交</span>
                </button>
                <div class="col-xs-1"></div>
                <a href="javascript:parent.layer.closeAll();" class="btn btn-default col-xs-1">返回</a>
            </div>
        </div>
        <!-- /.box-footer -->
    </form>
</div>
{include file="common/footer_js" /}
{if('address' == $type)}
<script src="/static/area/cascade.js"></script>
{/if}
<script>
    function complete3(data) {
        if (data.code == 1) {
            layer.msg(data.msg, {icon: 6}, function (index) {
                layer.close(index);
                parent.location.reload();
                parent.layer.closeAll();
            });
        } else {
            layer.alert(data.msg, {icon: 5}, function (index) {
                $("#verify").val('');
                $("#verify_img").click();
                Ladda.stopAll();
                layer.close(index);
            });
        }
    }
</script>
<script>
    $(function () {
        setTimeout(resetHeight,1000);
        // 再次设置，防止出错
        setTimeout(resetHeight,5000);
    })
    function resetHeight() {
        if(parent.location.href != location.href){
            console.log('resetHeight')
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.iframeAuto(index); // 适配高度
        }
    }
</script>
{if('address' == $type && !empty($orderModel['address']))}
<script>
    $(function () {
        cascdeInit("0","0","{$orderModel['address']['province']}","{$orderModel['address']['city']}","{$orderModel['address']['area']}","");
    })
</script>
{/if}
{if('send' == $type || 'modify_send' == $type)}
<script>
    $(function () {
        $("#express").change(function () {
            var obj = $(this);
            var sel = obj.find("option:selected").attr("data-name");
            $("#expresscom").val(sel);
        });
    })
</script>
{/if}
</body>
</html>